From: Long Li Date: Wed, 16 Jul 2025 01:54:07 +0000 (+0800) Subject: [PATCH] memfs_ll: fix deadlock in truncate operation X-Git-Tag: archive/raspbian/3.17.2-3+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c3b00452f4bdba32d73f38cff88b3b95e8ec2299;p=fuse3.git [PATCH] memfs_ll: fix deadlock in truncate operation Remove redundant mutex lock acquisition in the truncate() method to prevent deadlock. The issue occurs when memfs_setattr() already holds the mutex lock and then calls truncate(), which attempts to acquire the same lock again. Signed-off-by: Long Li Gbp-Pq: Name memfs_ll-fix-deadlock.patch --- diff --git a/example/memfs_ll.cc b/example/memfs_ll.cc index 6038850..e587756 100644 --- a/example/memfs_ll.cc +++ b/example/memfs_ll.cc @@ -197,7 +197,6 @@ class Inode { void truncate(off_t size) { - std::lock_guard lock(mutex); std::lock_guard attr_lock(attr_mutex); if (size < content.size()) { content.resize(size);